package com.ruoyi.restaurant.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.restaurant.service.*;
import com.ruoyi.restaurant.vo.BillsVo;
import com.ruoyi.restaurant.vo.DashboardVo;
import com.ruoyi.restaurant.vo.PriceVo;
import com.ruoyi.restaurant.vo.TableNumsVo;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/views")
public class PieController extends BaseController {
    private ISysJiagongService sysJiagongService;
    private ISysDiancanService sysDiancanService;
    private ISysCategoryService sysCategoryService;
    private ISysTableService sysTalbeService;
    private ISysBillService sysBillService;

    /**
     * Echarts饼状图数据接口
     * @return
     */

    /**
     * 环状图接口
     * @return
     */
    @GetMapping("/testchartsv2/pie")
    public ResponseEntity<List<DashboardVo>> pie(){
        return ResponseEntity.ok(this.sysJiagongService.countByCategoryNames());
    }

    /**
     * 横向柱状图接口
     * @return
     */
    @GetMapping("/testchartsv2/categoryPie")
    public ResponseEntity<List<PriceVo>> categoryPie(){
        return ResponseEntity.ok(this.sysCategoryService.countByCategoryNames());
    }

    /**
     * 雷达图接口
     * @return
     */
    @GetMapping("/testchartsv2/tablePie")
    public ResponseEntity<List<TableNumsVo>> tablePie(){
        return ResponseEntity.ok(this.sysTalbeService.CountOrdersByTableId());
    }

    /**
     * 折线图接口
     * @return
     */
    @GetMapping("/testchartsv2/billLine")
    public ResponseEntity<List<BillsVo>> billLine(){
        return ResponseEntity.ok(this.sysBillService.countsBillsByDate());
    }




}
